From acca24e9c123729d45e7b3de348c434e489ff780 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Sat, 19 Dec 2009 12:28:46 +0100 Subject: [PATCH] Fix a crash on print preview There's no printer when doing print preview so it's not possible to get its hard margins. --- gtk/gtkprintoperation-unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/gtkprintoperation-unix.c b/gtk/gtkprintoperation-unix.c index 4ac60de879..f12ab01b37 100644 --- a/gtk/gtkprintoperation-unix.c +++ b/gtk/gtkprintoperation-unix.c @@ -547,7 +547,7 @@ finish_print (PrintResponseData *rdata, if (gtk_print_settings_get_number_up (settings) < 2) { - if (gtk_printer_get_hard_margins (printer, &top, &bottom, &left, &right)) + if (printer && gtk_printer_get_hard_margins (printer, &top, &bottom, &left, &right)) _gtk_print_context_set_hard_margins (priv->print_context, top, bottom, left, right); } else -- 2.30.2